import {API} from "@/api/NewAxiosAPI";

export async function getGroupMessageHistoryAPI(token: string, groupId: string, page: number, pageSize: number) {
    const r = await API({
        url: "/IM/group_message/history/" + groupId + "/" + page + "/" + pageSize,
        method: "GET",
        headers: {
            "Authorization": token
        }
    })
    return r.data
}

export async function sendGroupMessageAPI(message: string, groupId: string, token: string) {
    const r = await API({
        url:"/IM/group_message/send",
        method:"POST",
        data:{
            message:message,
            groupId:groupId,
            time:Date.now(),
        },
        headers:{
            "Authorization":token
        }
    })
    return r.data
}